home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Developer Utilities / Installer 4.0.3 SDK / Script Examples / • Some Useful Utilities / Rez & Go < prev    next >
Encoding:
Text File  |  1994-11-15  |  1.5 KB  |  54 lines  |  [TEXT/MPS ]

  1.         #************** for compiling Installer test scripts *******
  2.         #**        This compiles a Rez source file (like "foo.r") into the
  3.         #**        resource file with the same basename ("foo") and in the
  4.         #**        same directory as the source file. It then copies the
  5.         #**        compiled Rez file into the directory specified by the
  6.         #**        variable "TestDirectory" as "Test Script" and launches
  7.         #**        the Installer from that directory.
  8.         #*            NOTE: If you select a file whose name doesn't end
  9.         #*                  in ".r", the compilation won't take place.
  10.         #*
  11.  
  12. Set TestDirectory "::"
  13. export TestDirectory
  14.  
  15.         #*
  16.         #*    Blank out ®1 & ®2, and then set these to the active window.
  17.         #*    ®1: should contain the filename up to the .r extension, and
  18.         #*      ®2: should contain the .r extension.
  19.         #*
  20.  
  21. (Evaluate "  " !~ /(" ")®1(" ")®2/) > Dev:Null
  22.  
  23. IF "{Active}" =~ /≈.r/
  24.     Set ScriptFile "'{Active}'"
  25.   ELSE
  26.     Set ScriptFile `getfilename -t TEXT -b Rez-N-Go`
  27.     END
  28.     
  29.         #*
  30.         #*    Parse '.r' from filename.
  31.         #*
  32.         
  33. (Evaluate {ScriptFile} !~ /([a-zA-Z:0-9 .()-]*)®1(.r)®2/) > Dev:Null
  34.  
  35.         #*
  36.         #*  print time and rez the file if it ends in .r.
  37.         #*
  38.         
  39. IF "{®2}" == ".r"
  40.     Echo " " ∑∑ "{WorkSheet}"
  41.     Date ∑∑ "{WorkSheet}"
  42.     Echo "rezzing-> {®1}{®2}" ∑∑ "{WorkSheet}"
  43.     Echo " " ∑∑ "{WorkSheet}"
  44.     rez -o "{®1}" -t kajr -c kajr  "{®1}.r" ∑∑ "{WorkSheet}"
  45.     Duplicate -y "{®1}" "{TestDirectory}Test Script"
  46.     "{TestDirectory}Installer" ∑∑ "{WorkSheet}"
  47.     Date ∑∑ "{WorkSheet}"
  48.   ELSE
  49.     Echo " " ∑∑ "{WorkSheet}"
  50.     Echo "*** {ScriptFile} is not a Rez source file!! (name should end with .r)***" ∑∑ "{WorkSheet}"
  51.     Echo " " ∑∑ "{WorkSheet}"
  52.     END
  53.  
  54.